Skip to content

Conversation

Her-Code
Copy link

@Her-Code Her-Code commented Oct 8, 2025

Summary

This PR addresses issue #1974.
It introduces a new fluent builder API for synchronizing wallets with Electrum servers, making wallet synchronization as simple as a one-liner call. The ElectrumSync builder provides an intuitive, chainable interface for configuring and executing wallet sync operations, significantly improving developer experience and reducing boilerplate code for common synchronization tasks.

Features

  • Fluent Builder API : Implement fluent API for ElectrumSync configuration
  • Dual Sync Modes : Fast sync (revealed addresses only) and full scan (until stop gap)
  • Configurable Parameters : Server URL, stop gap, batch size, and transaction output fetching
  • Type Safety : Add ElectrumSyncResult<K> type alias.
  • Add new bdk_builder module with sync functionality

- Implement fluent API for Electrum sync configuration
- Add type alias to resolve clippy complexity warning
- Include comprehensive documentation and examples
- Add new bdk_builder module with sync functionality
- Implement fluent API for Electrum sync configuration
- Add type alias to resolve clippy complexity warning
- Include comprehensive documentation and examples
- Add new bdk_builder module with sync functionality
@Her-Code
Copy link
Author

Heyy @oleonardolima, I think there is an issue with the CI - the pin-msrv.sh script is falling on socket 2 version pinning. Mind taking a look?

Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's always good to have a simplier API. However, this approach has too many sacrifices.

  1. bdk_electrum should only depend on bdk_core (and not bdk_chain). This way, we can make breaking changes to bdk_chain and bdk_electrum will still be compatible with both bdk_wallet and bdk_chain (since bdk_wallet is on a different release cycle).

  2. We loose the cache once we drop BdkElectrumClient. Subsequent syncs/scans cannot make use of the cache - affecting performance.

I'm not sure if these problems can be easily solved - maybe you have some ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants